
function generate_level(num_rooms,level_width,level_height,num_passages){
		global.myroom = room_add();
		var chooser = irandom_range(0,4);
		if global.roomcount <= 1
		{chooser = 1} else chooser = irandom_range(0,4);
		switch(chooser) 
		{
		case (0):
		room_assign(global.myroom,r_Underworld );
		break;
		case (1):
		room_assign(global.myroom,r_Metro );
		break;
		case (2):
		room_assign(global.myroom,r_Midstreet );
		break;
		case (3):
		room_assign(global.myroom,r_Downstreet );
		break;
		case (4):
		room_assign(global.myroom,r_Mairstreet );
		break;
		}
		room_set_width(global.myroom, level_width);
		room_set_height(global.myroom, level_height);
		room_set_persistent(global.myroom, false);
}
